Skip to content

Add CdrObjectOverlay Component with Positioning and Customization Options#206

Merged
c4rlosviteri merged 16 commits intomainfrom
pr/object-overlay
Mar 19, 2025
Merged

Add CdrObjectOverlay Component with Positioning and Customization Options#206
c4rlosviteri merged 16 commits intomainfrom
pr/object-overlay

Conversation

@c4rlosviteri
Copy link
Copy Markdown
Contributor

@c4rlosviteri c4rlosviteri commented Feb 28, 2025

This pull request introduces the CdrObjectOverlay component—a flexible overlay solution for positioning content relative to a container in nine different positions. The component is designed to be highly customizable, allowing developers to adjust the positioning, margin, and even the HTML tag used for the overlay container.

Key Features

  • Flexible Positioning: The component accepts a position prop that supports the following values:

    • top-left, top-center, top-right
    • left, center, right
    • bottom-left, bottom-center, bottom-right
    • The default position is set to center.
  • Customizable Margin: The margin prop allows developers to specify the spacing around the overlay content. By default, this is set to 0.

  • HTML Tag Customization: With the tag prop, you can define the HTML tag for the container element. The default is div, but it can be changed to any valid HTML tag (e.g., section, article).

  • Slots for Content: The component defines two slots:

    • container: For the content the overlay will be positioned relative to.
    • content: For the actual overlay content.

This PR adds a versatile overlay component that aligns with our existing design system and development patterns. The tests ensure reliability and consistency, preparing this component for integration into larger projects.

@c4rlosviteri c4rlosviteri requested a review from mhewson February 28, 2025 18:42
@mhewson mhewson requested a review from saagude March 13, 2025 17:05
@mhewson
Copy link
Copy Markdown
Member

mhewson commented Mar 18, 2025

Screenshot 2025-03-18 at 7 54 16 AM It looks like the gradient is clipping, but the overlay content is not

Spacing,
Gradient,
ResponsiveGradient
} from '../../types/interfaces';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at what point do we want to start types/interfaces/"file" or "pattern"


// Dark theme gradients (default)
$dark-gradients: (
'to-top': linear-gradient(to top, black 0%, rgba(0, 0, 0, 0.5) 20%, transparent 40%),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that the updated black value from Michelle?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I think these are good candidates for custom props, and gradient tokens

@c4rlosviteri c4rlosviteri merged commit 94fac74 into main Mar 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants